$(function() {
	$("#login").click(function() {
		var uname = $("#txtusername").val();
		var upass = $("#txtPassword").val();
		var role = $('input:radio:checked').val();
		if (role == "2") {
			$.ajax({
				url: "http://150.158.27.246:12002/web/user/adminLogin",
				type: "get",
				data: {
					"username": uname,
					"password": upass
				},
				dataType: "json",
				success: function(data, dataTextStatus, jqxhr) {

					var data1 = data;
					var dataTextStatus1 = dataTextStatus;
					var jqxhr1 = jqxhr;

				},
				error: function(jqxhr, textStatus, error) {
					var error1 = error;
					var textStatus1 = textStatus;
					var jqxhr1 = jqxhr;
				}
			});

		} else {
			$.ajax({
				url: "http://150.158.27.246:12002/web/user/studentLogin",
				type: "get",
				data: {
					"username": uname,
					"password": upass
				},
				dataType: "json",
				success: function(data, dataTextStatus, jqxhr) {

					var data1 = data;
					var dataTextStatus1 = dataTextStatus;
					var jqxhr1 = jqxhr;

				},
				error: function(jqxhr, textStatus, error) {
					var error1 = error;
					var textStatus1 = textStatus;
					var jqxhr1 = jqxhr;
				}
			});

		}
	})
})
